<template>
    <view class="message"  v-if="visible">
      <view class="content">{{content}}
      </view>
    </view>
</template>

<script>
  export default {
    name: "message",
    data() {
      return {
        content: '',
        time: 3000,
        visible: false,
        type:'info',//'success','warning','error'
        hasClose:false,
      }
    },
    mounted() {
      this.close()
    },
    methods: {
      close() {
        window.setTimeout(() =>{
          this.visible = false
        }, this.time);
      }
    }
  }
</script>
<style lang="scss">
.message{
  position: fixed;
  height: px2vw(40);
  line-height: px2vw(40);
  padding: px2vw(5) 0;
  font-size: px2vw($fz16);
  background-color: #333;
  color: #fff;
  border-radius: px2vw(5);
   max-width: 60%;
  text-align: center;
  position:fixed;
  margin:auto;
  left:0;
  right:0;
  top:0;
  bottom:0;
}


</style>